<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Title</title>
</head>
<body>

</body>
<script>
	var a = [];
	// for (let i = 0; i < 10; i++) {
	// 	a[i] = function () {
	// 		console.log(i);
	// 	};
	// }
	
	{
		let i=0;
		a[i] = function(){
			console.log(i);
		}
	}
	{
		let i=1;
		a[i] = function(){
			console.log(i);
		}
	}
	{
		let i=2;
		a[i] = function(){
			console.log(i);
		}
	}
	{
		let i=3;
		a[i] = function(){
			console.log(i);
		}
	}
	{
		let i=4;
		a[i] = function(){
			console.log(i);
		}
	}
	{
		let i=5;
		a[i] = function(){
			console.log(i);
		}
	}
	{
		let i=6;
		a[i] = function(){
			console.log(i);
		}
	}
	{
		let i=7;
		a[i] = function(){
			console.log(i);
		}
	}
	{
		let i=8;
		a[i] = function(){
			console.log(i);
		}
	}
	{
		let i=9;
		a[i] = function(){
			console.log(i);
		}
	}
	a[6]();
</script>
</html>